Open
Conversation
8db1da4 to
e8129f7
Compare
tobymao
reviewed
Apr 24, 2026
tobymao
reviewed
Apr 24, 2026
tobymao
reviewed
Apr 24, 2026
tobymao
reviewed
Apr 24, 2026
VaggelisD
added a commit
that referenced
this pull request
Apr 27, 2026
…UDE] Review feedback from #7558: - sqlglot/__init__.py: drop the *__mypyc*.so bootstrap preloader; legacy hash-named .so layout doesn't happen with separate=True. - sqlglot/optimizer/__init__.py: rename _t to t, tighten the docstring. Drop py3.9 support for sqlglot[c]: sqlglot-mypy 1.20+ doesn't ship a py3.9 wheel and the older 1.19.x line (which has a universal py3-none-any wheel) predates the separate=True fixes, so py3.9 CI was crashing with "vtable not computed yet" while trying to build sqlglotc. - setup.py: gate the [c] / [rs] extras on python_version >= 3.10, so `pip install sqlglot[c]` on 3.9 is a no-op (you get pure-Python sqlglot). - sqlglotc/pyproject.toml: bump requires-python to 3.10, pin sqlglot-mypy >= 1.20.0 in build + dev requires. - Makefile: install-devc / install-devc-release skip the sqlglotc build on 3.9 instead of failing. sqlglot itself still supports py3.9; only the optional compiled extension requires 3.10+.
…[CLAUDE] sqlglot-mypy 1.20.0.post3 makes mypyc's separate=True compilation work correctly on real-world projects (cross-group class inheritance, generator helper classes, non-ext subclasses with fast methods, mutually-dependent compiled modules). Turning it on for sqlglotc cuts incremental rebuild time dramatically — a 1-file edit goes from ~110s (full monolithic rebuild) to ~3s. Three small changes: - sqlglotc/setup.py: pass separate=True to mypycify(). Produces one shared lib + shim pair per module instead of one monolithic shared lib; mypyc only regenerates the changed module's C on rebuild. - sqlglot/__init__.py: tighten the `*__mypyc.so` bootstrap preloader. Under separate=True, per-module shared libs (e.g. errors__mypyc.so) live next to their .py sources and are resolved via normal dotted imports through the shim. Skip preloading those; keep the legacy preload behavior only for monolithic-hash .so files that lack a .py sibling. - sqlglot/optimizer/__init__.py: make the top-level re-exports lazy via PEP 562 __getattr__. Under separate=True's eager cross-group init, the previous eager `from sqlglot.optimizer.optimizer import ...` could trigger while sqlglot's own __init__.py was mid-flight, hitting a circular-import ImportError on `from sqlglot import Schema, exp`. Lazy imports defer the cycle to first use.
VaggelisD
added a commit
that referenced
this pull request
Apr 27, 2026
…UDE] Review feedback from #7558: - sqlglot/__init__.py: drop the *__mypyc*.so bootstrap preloader; legacy hash-named .so layout doesn't happen with separate=True. - sqlglot/optimizer/__init__.py: rename _t to t, tighten the docstring. Drop py3.9 support for sqlglot[c]: sqlglot-mypy 1.20+ doesn't ship a py3.9 wheel and the older 1.19.x line (which has a universal py3-none-any wheel) predates the separate=True fixes, so py3.9 CI was crashing with "vtable not computed yet" while trying to build sqlglotc. - setup.py: gate the [c] / [rs] extras on python_version >= 3.10, so `pip install sqlglot[c]` on 3.9 is a no-op (you get pure-Python sqlglot). - sqlglotc/pyproject.toml: bump requires-python to 3.10, pin sqlglot-mypy >= 1.20.0 in build + dev requires. - Makefile: install-devc / install-devc-release skip the sqlglotc build on 3.9 instead of failing. sqlglot itself still supports py3.9; only the optional compiled extension requires 3.10+.
6ac5ab9 to
949c883
Compare
…UDE] Review feedback from #7558: - sqlglot/__init__.py: drop the *__mypyc*.so bootstrap preloader; legacy hash-named .so layout doesn't happen with separate=True. - sqlglot/optimizer/__init__.py: rename _t to t, tighten the docstring. Drop py3.9 support for sqlglot[c]: sqlglot-mypy 1.20+ doesn't ship a py3.9 wheel and the older 1.19.x line (which has a universal py3-none-any wheel) predates the separate=True fixes, so py3.9 CI was crashing with "vtable not computed yet" while trying to build sqlglotc. - setup.py: gate the [c] / [rs] extras on python_version >= 3.10, so `pip install sqlglot[c]` on 3.9 is a no-op (you get pure-Python sqlglot). - sqlglotc/pyproject.toml: bump requires-python to 3.10, pin sqlglot-mypy >= 1.20.0 in build + dev requires. - Makefile: install-devc / install-devc-release skip the sqlglotc build on 3.9 instead of failing. sqlglot itself still supports py3.9; only the optional compiled extension requires 3.10+.
949c883 to
176b79a
Compare
VaggelisD
added a commit
that referenced
this pull request
Apr 28, 2026
…fy [CLAUDE] Temporary debug aid for #7558: integration tests are producing a ~530KB wheel that's missing all shared-lib .so files, but local builds produce the full 18MB wheel. Add stderr prints so pip's failure output shows what python/mypyc/source-dir setup.py actually saw, plus a hard exit if mypycify returns zero shared-lib Extensions, so we get a clear error instead of a silently-broken wheel. Will revert once we've identified the root cause.
VaggelisD
added a commit
that referenced
this pull request
Apr 28, 2026
…fy [CLAUDE] Temporary debug aid for #7558: integration tests are producing a ~530KB wheel that's missing all shared-lib .so files, but local builds produce the full 18MB wheel. Add stderr prints so pip's failure output shows what python/mypyc/source-dir setup.py actually saw, plus a hard exit if mypycify returns zero shared-lib Extensions, so we get a clear error instead of a silently-broken wheel. Will revert once we've identified the root cause.
ff7a90c to
69aed12
Compare
VaggelisD
added a commit
that referenced
this pull request
Apr 28, 2026
…fy [CLAUDE] Temporary debug aid for #7558: integration tests are producing a ~530KB wheel that's missing all shared-lib .so files, but local builds produce the full 18MB wheel. Add stderr prints so pip's failure output shows what python/mypyc/source-dir setup.py actually saw, plus a hard exit if mypycify returns zero shared-lib Extensions, so we get a clear error instead of a silently-broken wheel. Will revert once we've identified the root cause.
69aed12 to
041b5ff
Compare
VaggelisD
added a commit
that referenced
this pull request
Apr 28, 2026
…fy [CLAUDE] Temporary debug aid for #7558: integration tests are producing a ~530KB wheel that's missing all shared-lib .so files, but local builds produce the full 18MB wheel. Add stderr prints so pip's failure output shows what python/mypyc/source-dir setup.py actually saw, plus a hard exit if mypycify returns zero shared-lib Extensions, so we get a clear error instead of a silently-broken wheel. Will revert once we've identified the root cause.
041b5ff to
515d038
Compare
…fy [CLAUDE] Temporary debug aid for #7558: integration tests are producing a ~530KB wheel that's missing all shared-lib .so files, but local builds produce the full 18MB wheel. Add stderr prints so pip's failure output shows what python/mypyc/source-dir setup.py actually saw, plus a hard exit if mypycify returns zero shared-lib Extensions, so we get a clear error instead of a silently-broken wheel. Will revert once we've identified the root cause.
515d038 to
ab9622e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Switch
sqlglotc's mypyc build toseparate=True, plus the two small sqlglot-side tweaks needed to make it work end-to-end.The
separate=Trueflag gives each compiled module its own shared lib + shim, so mypyc only has to regenerate / recompile the modules whose source actually changed. Clean builds are roughly the same wall-clock; incremental rebuilds after a one-line edit drop dramatically once the cache is warm.Three small changes, all behind the
[c]compile path:sqlglotc/setup.py: passseparate=Truetomypycify(). Everything else in the build recipe is unchanged.sqlglot/__init__.py: the existing*__mypyc*.sobootstrap preloader was written for the old monolithic build where a single hash-named.sosat at the package root. Underseparate=Truethe per-module shared libs (e.g.errors__mypyc.so) live next to their.pysiblings and resolve through Python's normal import machinery via the shim. Skip preloading those; keep the legacy behavior only for.sofiles that don't have a.pysibling.sqlglot/optimizer/__init__.py: swap the eager top-level re-exports for PEP 562 lazy__getattr__. Underseparate=True's cross-group init ordering, the previous eagerfrom sqlglot.optimizer.optimizer import ...could fire whilesqlglot's own__init__.pywas still mid-bootstrap, hitting a circular-importImportErroronfrom sqlglot import Schema, exp. Lazy imports defer the cycle to first use.